<?
/**
 * Copyright 2007 Melange.
 *
 * This file is part of PHP-MELANGE.
 *
 * PHP-MELANGE is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * PHP-MELANGE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PHP-MELANGE; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @category    Melange
 * @package     php-melange
 * @subpackage  cms
 * @copyright   Copyright (c) 2007 Jeroen Simons. All rights reserved
 * @author      Jeroen Simons <jeroen@melange.nl>
 * @link        http://www.melange.nl/
 *
 */

class ImageProperties {


    // ----------------------------------------------------- Instance Variables


    /**
     * The secure of the optimalization.
     */
    private $secure;


    /*
     * Mode to scale image
     */
    private $iMode;


    /*
     * Image background color
     */
    private $iColor;


    /**
     * The axis to scale the large image with (x or y).
     */
    private $iAxis;


    /**
     * The width of the large image in pixels.
     */
    private $iWidth;


    /**
     * The height of the large image in pixels.
     */
    private $iHeight;


    /**
     * The axis to scale the thumbnail with (x or y).
     */
    private $tAxis;


    /*
     * Mode to scale thumbnail
     */
    private $tMode;


    /*
     * Thumbnail background color
     */
    private $tColor;


    /**
     * The width of the thumbnail in pixels.
     */
    private $tWidth;


    /**
     * The height of the thumbnail in pixels.
     */
    private $tHeight;


    // ----------------------------------------------------------- Constructors


    public function __construct($properties) {

        $this->log =& LoggerManager::getLogger("ImageUtil");

        $properties = explode(":", $properties);

        $this->secure  = $properties[0];
        $this->iAxis   = $properties[1];
        $this->iMode   = intval($properties[2]);
        $this->iColor  = $properties[3];
        $this->iWidth  = intval($properties[4]);
        $this->iHeight = intval($properties[5]);
        $this->tAxis   = $properties[6];
        $this->tMode   = intval($properties[7]);
        $this->tColor  = $properties[8];
        $this->tWidth  = intval($properties[9]);
        $this->tHeight = intval($properties[10]);

    }


    // --------------------------------------------------------- Public Methods


    /**
     * Return the Secure for these properties
     */
    public function getSecure() {
        return $this->secure == "secure";
    }


    /**
     * Return the axis to resize the image over.
     */
    public function getImageAxis() {
        return $this->iAxis;
    }


    /**
     * Return the mode to resize the image with.
     */
    public function getImageMode() {
        return $this->iMode;
    }


    /**
     * Return the image background color.
     */
    public function getImageColor() {
        return $this->iColor;
    }


    /**
     * Return the new image width.
     */
    public function getImageWidth() {
        return $this->iWidth;
    }


    /**
     * Return the new image height.
     */
    public function getImageHeight() {
        return $this->iHeight;
    }


    /**
     * Return the axis to resize the thumbnail over.
     */
    public function getThumbAxis() {
        return $this->tAxis;
    }


    /**
     * Return the mode to resize the thumbnail with.
     */
    public function getThumbMode() {
        return $this->tMode;
    }


    /**
     * Return the thumbnail background color.
     */
    public function getThumbColor() {
        return $this->tColor;
    }


    /**
     * Return the new image width.
     */
    public function getThumbWidth() {
        return $this->tWidth;
    }


    /**
     * Return the new image height.
     */
    public function getThumbHeight() {
        return $this->tHeight;
    }


}
?>